package com.azt.api.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 购物车列表DTO
 */
public class CartListData implements Serializable {

    private Integer companyId;

    private String companyName;

    private boolean cenMember;      //是否是集采供应商

    private String qq;

    private boolean canBuy;

    private List<CartProduct> productList = new ArrayList<>();

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public List<CartProduct> getProductList() {
        return productList;
    }

    public void setProductList(List<CartProduct> productList) {
        this.productList = productList;
    }

    public boolean isCenMember() {
        return cenMember;
    }

    public void setCenMember(boolean cenMember) {
        this.cenMember = cenMember;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public boolean isCanBuy() {
        if(getProductList() != null && getProductList().size() > 0) {
            for(CartProduct product : productList) {
                if(product.isCanBuy()) {
                    return true;
                }
            }
        }
        return false;
    }

    public void setCanBuy(boolean canBuy) {
        this.canBuy = canBuy;
    }
}
